<!--#include file="../nav/top.php" -->
<!--#include file="../nav_menu/user_begin.php" -->
<style type="text/css">
.vegediv_fix{
border: 1px solid #B2D9F0;
color: #0082CB;
background-color:#E8F3FF;
float: left;
margin: 1px 3px;
padding: 3px;
text-decoration: none;
}
.vegediv_slt{
border: 1px solid #CCCCCC;
color: #999999;
float: left;
margin: 1px 3px;
padding: 3px;
text-decoration: none;
}
.vegediv_slt_on{
border: 1px solid #B2D9F0;
color: #0082CB;
background-color:#E8F3FF;
}
</style>
		<div class="infotitle">
			选菜计划
		</div> 
	 
		<div id="grids" style="border:0px solid #666666;width:760px;"></div>
		 
<script type="text/javascript">
var url_list = '/user/now';
var url_modify = '/user/now_modify';


$().ready(function(){
	o2js.build('ymprompt');
	o2js.build('o2grid');
	showLoading();
	grids = new o2Grid({
		bind:'grids', 
		url:url_list,
		rowNum: 20,
		imgpath:'/misc/vendors/o2js/o2grid/image',
		cols:[
			{index:'id',mapping:'a.id', name:'序号', width:35,align:'center', sortable:false, func:function(val,row_index,column_name,json,R){
				 return  '<span title="ID：'+json.id+'" >'+((R.page - 1)*R.rowNum + (row_index+1))+'</span>';
			}},
			{index:'senddate',mapping:'b.senddate', name:'配送日期', width:70 
			},
			{index:'senddate',mapping:'b.senddate',sortable:false,align:'center', name:'总份数', width:50  ,func:function(val,row_index,column_name,json,R){
				var s=0;
				for(var i=0; i<json.veges.length; i++){
					s += strToNum(json.veges[i].num);
				}
				return s;
			}
			},
			{index:'packet',mapping:'a.packet', name:'配送菜品',sortable:false, width:450 ,func:function(val,row_index,column_name,json,R){
				  
				return json.veges_html;
			}
			}, 
			{index:'status',mapping:'b.status', name:'状态',sortable:false, width:50 ,align:'center', func:function(val,row_index,column_name,json,R){
					if(val == '0'){
						return  '<span class=" ">计划中</span>';
					}else if(val == '1'){
						return  '<span style="color:red">生产中</span>';
					}else{
						return '<span style="color: ">已完成</span>';
					}
			}
			},
			{index:'id',mapping:'a.id', name:'操作',sortable:false, width:60 ,align:'center', func:function(val,row_index,column_name,json,R){
					 
					var s = ' <a href="javascript:void(0)" onclick="fnModifySendVege('+json.id+')" style="color:blue" >修改选菜</a>'; 
					return s;
			}
			}
		]
	});
	grids.load(1);
});
function fnSearchs(){
	grids.setBaseParams({ 
	}); 
	grids.load(1); 
}
 
/* 修改基本信息 */
function fnModifySendVege(id){
	ymPrompt.close();
	ymPrompt.win({
		title:'修改选菜',
		fixPosition:true,
		maxBtn:true,
		width: 700, 
		height: 500,
		iframe:{
			src:url_modify+'?id='+id+'&endfunc=fnModifySendVegeEnd'
		}
	});
}
function fnModifySendVegeEnd(){
	grids.reload();
}
 
</script>	 	


<!--#include file="../nav_menu/user_end.php" -->
<!--#include file="../nav/bottom.php" -->